Skip to content

Conversation

@mmustafa-tse
Copy link
Contributor

Summary

  • A customer noticed that the getter for mediaTimeSpent calculates the value based on the difference between mediaSessionEndTimestamp and mediaSessionStartTimestamp, which leads to inaccuracy since mediaSessionEndTimestamp is only updated when logging a media event, with this PR it now calculates based on on the difference between Date.now() (current time) and mediaSessionStartTimestamp

Testing Plan

  • Was this tested locally? If not, explain why.
  • E2E and unit tested

Reference Issue (For mParticle employees only. Ignore if you are an outside contributor)

Comment on lines +1487 to +1488
expect(mpMediaTimeSpent).to.greaterThanOrEqual(200);
expect(mpMediaTimeSpent).to.lessThanOrEqual(300);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine for now. But I made a ticket to use jest timers in the future.

@alexs-mparticle alexs-mparticle merged commit a6c72b2 into mParticle:development Jul 7, 2025
5 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants